import type { GlobalStore } from '@/types'

const useGlobalStore = defineStore('globalStore', {
  state: (): GlobalStore => ({
    isRefresh: false,
    navigationUrlData: new Set([]),
    isMenuRefresh: false,
  }),
  actions: {
    async refresh() {
      this.isRefresh = true
      await nextTick()
      this.isRefresh = false
    },
    async refreshMenu() {
      this.isMenuRefresh = true
      await nextTick()
      this.isMenuRefresh = false
    },
  },
})

export default useGlobalStore
